package com.wejoy.video.middle.station.data.vo.api;/**
 * @Author 张文杰
 * @PackageName video-middle-station
 * @Package com.wejoy.video.middle.station.data.vo.api
 * @Date 2022/12/30 11:45 AM
 * @Version 1.0
 */

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.Gson;

import java.util.Arrays;
import java.util.List;

/**
 * @BelongsProject: video-middle-station
 * @BelongsPackage: com.wejoy.video.middle.station.data.vo.api
 * @Author: zhangwenjie
 * @CreateTime: 2022-12-30  11:45
 * @Description: TODO
 * @Version: 1.0
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ChannelVo {

    @JsonProperty("marker")
    private String marker;
    @JsonProperty("nextMarker")
    private String nextMarker;
    @JsonProperty("truncated")
    private Boolean truncated;
    @JsonProperty("data")
    private List<DataDTO> data;

    public static ChannelVo objectFromData(String str) {

        return new Gson().fromJson(str, ChannelVo.class);
    }

    public String getMarker() {
        return marker;
    }

    public void setMarker(String marker) {
        this.marker = marker;
    }

    public Boolean isTruncated() {
        return truncated;
    }

    public void setTruncated(Boolean truncated) {
        this.truncated = truncated;
    }

    public List<DataDTO> getData() {
        return data;
    }

    public void setData(List<DataDTO> data) {
        this.data = data;
    }

    public String getNextMarker() {
        return nextMarker;
    }

    public void setNextMarker(String nextMarker) {
        this.nextMarker = nextMarker;
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class DataDTO {
        @JsonProperty("deviceId")
        private Integer deviceId;
        @JsonProperty("channelId")
        private Integer channelId;
        @JsonProperty("channelName")
        private String channelName;
        @JsonProperty("gbName")
        private String gbName;
        @JsonProperty("channelGbId")
        private String channelGbId;
        @JsonProperty("channelStatus")
        private String channelStatus;
        @JsonProperty("manufacturer")
        private String manufacturer;
        @JsonProperty("appStream")
        private String appStream;
        @JsonProperty("parentNodeId")
        private Integer parentNodeId;
        @JsonProperty("aiTypes")
        private String[] aiTypes;

        public static DataDTO objectFromData(String str) {

            return new Gson().fromJson(str, DataDTO.class);
        }

        public Integer getDeviceId() {
            return deviceId;
        }

        public void setDeviceId(Integer deviceId) {
            this.deviceId = deviceId;
        }

        public Integer getChannelId() {
            return channelId;
        }

        public void setChannelId(Integer channelId) {
            this.channelId = channelId;
        }

        public String getChannelName() {
            return channelName;
        }

        public void setChannelName(String channelName) {
            this.channelName = channelName;
        }

        public String getGbName() {
            return gbName;
        }

        public void setGbName(String gbName) {
            this.gbName = gbName;
        }

        public String getChannelGbId() {
            return channelGbId;
        }

        public void setChannelGbId(String channelGbId) {
            this.channelGbId = channelGbId;
        }

        public String getChannelStatus() {
            return channelStatus;
        }

        public void setChannelStatus(String channelStatus) {
            this.channelStatus = channelStatus;
        }

        public String getManufacturer() {
            return manufacturer;
        }

        public void setManufacturer(String manufacturer) {
            this.manufacturer = manufacturer;
        }

        public String getAppStream() {
            return appStream;
        }

        public void setAppStream(String appStream) {
            this.appStream = appStream;
        }

        public Integer getParentNodeId() {
            return parentNodeId;
        }

        public void setParentNodeId(Integer parentNodeId) {
            this.parentNodeId = parentNodeId;
        }

        public String[] getAiTypes() {
            return aiTypes;
        }

        public void setAiTypes(String[] aiTypes) {
            this.aiTypes = aiTypes;
        }

        @Override
        public String toString() {
            return "{" +
                    "deviceId=" + deviceId +
                    ", channelId=" + channelId +
                    ", channelName='" + channelName + '\'' +
                    ", gbName='" + gbName + '\'' +
                    ", channelGbId='" + channelGbId + '\'' +
                    ", channelStatus='" + channelStatus + '\'' +
                    ", manufacturer='" + manufacturer + '\'' +
                    ", appStream='" + appStream + '\'' +
                    ", parentNodeId=" + parentNodeId +
                    ", aiTypes=" + Arrays.toString(aiTypes) +
                    '}';
        }
    }

    @Override
    public String toString() {
        return "ChannelVo{" +
                "marker='" + marker + '\'' +
                ", nextMarker='" + nextMarker + '\'' +
                ", truncated=" + truncated +
                ", data=" + data +
                '}';
    }
}
